<?php
/**
 * Created by PhpStorm.
 * User: zhaoye
 * Date: 16/7/15
 * Time: 下午3:58
 */

namespace controller\Api;

use ZPHP\Controller\Controller;
use ZPHP\Core\Db;
use ZPHP\Core\Log;

class Base extends Controller{
    public $isApi = true;

    public function init()
    {
        if(parent::init())
        {
            //解决跨域
            $this->setHeader('Access-Control-Allow-Methods', 'GET, POST');
            $this->setHeader('Access-Control-Allow-Headers', 'Origin, Content-Type, Cookie, Accept, multipart/form-data, application/json,x-requested-with');
            $this->setHeader('Access-Control-Allow-Origin', '*');
            return true;
        }
        else
        {
            return false;
        }

    }



}
